<template>
  <div>
    <yfu-form :formParam="formParam"  v-on:saveFormSuccess="saveFormSuccess">

    </yfu-form>
  </div>
</template>
<script type="text/javascript">
  import yfuForm from '@/components/common/yfuForm.vue'
  export default {
    components: {
      'yfu-form': yfuForm
    },
    methods: {
      // 保存成功回调方法
      saveFormSuccess (data) {
        console.log('savesuccess')
      }
    },
    data () {
      return {
        formParam: {
          baseURL: process.env.BASE_API,
          url: 'save.do',
          items: [
            {
              prop: 'name0',
              label: '禁用输入',
              type: 'inputDisabled'
            },
            {
              prop: 'name0',
              label: 'INPUT',
              type: 'input',
              display: 'displayNone'
            },
            {
              prop: 'name1',
              label: 'INPUT',
              type: 'input',
              rules: {required: true, maxLength: 30}
            },
            {
              prop: 'name2',
              label: 'TEXTAREA',
              type: 'textarea',
              rows: 3,
              rules: {required: true, maxLength: 30}
            },
            {
              prop: 'name3',
              label: 'INPUTNUMBER',
              type: 'inputnumber',
              min: 1,
              max: 20,
              rules: {required: true, maxLength: 30}
            },
            {
              prop: 'name4',
              label: 'SELECT',
              type: 'select',
              valueName: 'id',
              labelName: 'roleName',
              url: '',
              options: [{
                id: '1',
                roleName: '黄金糕'
              }, {
                id: '2',
                roleName: '双皮奶'
              }, {
                id: '3',
                roleName: '蚵仔煎'
              }, {
                id: '4',
                roleName: '龙须面'
              }, {
                id: '5',
                roleName: '北京烤鸭'
              }]
            },
            {
              prop: 'name5',
              label: 'SELECTSEARCH',
              type: 'selectsearch',
              valueName: 'id',
              labelName: 'roleName',
              url: '/static/selectList.json',
              urlParam: {
                organizationId: 1
              },
              options: []
            },
            {
              prop: 'name6',
              label: 'radio',
              type: 'radio',
              labelName: 'label',
              options: [{
                id: 1,
                label: 'hello'
              }, {
                id: 2,
                label: 'hello2'
              }]
            },
            {
              prop: 'name8',
              label: 'checkbox',
              type: 'checkbox',
              labelName: 'label',
              min: 1,
              max: 4,
              options: [{
                id: 1,
                label: 'hello'
              }, {
                id: 2,
                label: 'hello2'
              }, {
                id: 3,
                label: 'hello3'
              }, {
                id: 4,
                label: 'hello4'
              }]
            },
            {
              prop: 'name9',
              label: 'switch',
              type: 'switch'
            },
            {
              prop: 'name10',
              label: 'date',
              type: 'date'
            },
            {
              prop: 'name11',
              label: 'datetime',
              type: 'datetime'
            }
          ]
        }
      }
    }
  }
</script>
<style>
</style>
